package com.py.credit.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.common.InspectRule;
import com.py.framework.core.common.Page;

public interface ColumnRuleDao {

	/**
	 * 添加字段规则
	 * 
	 * @param ruleName
	 * @param ruleDesc
	 * @param rulePackage
	 * @param ruleMethod
	 * @param time
	 * @param managerId
	 */
	void add(@Param(value = "ruleName") String ruleName, @Param(value = "ruleDesc") String ruleDesc,
			@Param(value = "rulePackage") String rulePackage, @Param(value = "ruleMethod") String ruleMethod,
			@Param(value = "managerId") Long managerId, @Param(value = "time") String time,
			 @Param(value = "ruleMsg") String ruleMsg);

	/**
	 * 删除字段规则
	 * 
	 */
	void delete(@Param(value = "ids") List<String> ids);

	/**
	 * 查询单个字段规则
	 * 
	 * @param id
	 */
	InspectRule select(@Param(value = "id") int id);

	/**
	 * 修改字段规则
	 * 
	 * @param id
	 * @param ruleName
	 * @param ruleDesc
	 * @param rulePackage
	 * @param ruleMethod
	 * @param time
	 * @param managerId
	 */
	void modify(@Param(value = "id") int id, @Param(value = "ruleName") String ruleName,
			@Param(value = "ruleDesc") String ruleDesc, @Param(value = "rulePackage") String rulePackage,
			@Param(value = "ruleMethod") String ruleMethod, @Param(value = "managerId") Long managerId,
			@Param(value = "time") String time, @Param(value = "ruleMsg") String ruleMsg);

	public int selectSameName(@Param(value = "ruleName") String ruleName);

	public List<Map<String, Object>> selectByConditionForPage(@Param(value = "columns") List<String> columns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> conditions, @Param(value = "page") Page page,
			@Param(value = "editionId") Integer editionId, @Param(value = "fieldId") String fieldId);

	public List<Map<String, Object>> selectNoVersionByConditionForPage(@Param(value = "columns") List<String> columns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> conditions, @Param(value = "page") Page page);

	List<Map<String, Object>> selectByCondition(@Param(value = "columnEN") List<String> columnEN,
			@Param(value = "conditions") List<String> conditions);

	List<InspectRule> selectColumnRules(@Param(value = "ruleName") String ruleName);

	List<InspectRule> selectBindRuleColumnsForPage(@Param(value = "version") Integer version,
			@Param(value = "ruleId") String ruleId, @Param(value = "resourceName") String resourceName,
			@Param(value = "page") Page page);

}
